package com.jackdeng.tableview.demo;

import android.app.Activity;
import android.os.Bundle;

import com.jackdeng.tableview.library.TableView;

import java.util.Arrays;
import java.util.List;

/**
 * Author:<a href='https://gitee.com/code_jack/CustomTableView'
 * <p>
 * CrateTime:2017-2-4 16:02:39
 * <p>
 * Description:demo
 */
public class MainActivity extends Activity {

    private TableView tableView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tableView = (TableView) findViewById(R.id.table);
        Integer[] ints = {2, 0, 1, 3, 0, 0, 1};
        List<Integer> list = Arrays.asList(ints);
        tableView.clearTableContents()
                 .setRowTypes(list)
                .setHeader("知识点", "题号", "总分","个人得分","班均","知识达成度")
                .addContent("立体几何", "1", "20","16","14.25","3%")
                .addContent("立体几何", "3", "12","10","8.88","3%")
                .addContent("函数", "4", "12","10","8.88","30%")
                .addContent("概率", "8", "10","15","5.08","2%")
                .addContent("概率", "6", "12","10","8.88","2%")
                .addContent("概率", "7", "12","10","8.88","2%")
                .addContent("平面向量", "13", "12","10","8.88","15%")
                .refreshTable();
    }
}
